<?php
//启动session
session_start ();
//引入数据库连接文件
require_once 'include/conn.php';
$username = @$_POST ["username"];
$password = @md5 ( $_POST ["password"] );
$sql = "select * from user where name='" . $username . "' and password='" . $password . "'";
$result = mysql_query ( $sql );
if (mysql_num_rows ( $result )) {
	$row = mysql_fetch_array ( $result );
	$_SESSION ["name"] = $row ["reallyName"];
	$_SESSION ["user"] = $username;
	$_COOKIE ["user"] = $username;
	//加@可以忽略警告提示
	@$_COOKIE ["password"] = $_POST ["password"];
	echo true;
} else {
	echo false;
}
?>